/**
 * User: alesj
 * Date: 23.1.2006
 * Time: 9:41:25
 * 
 * (C) Genera Lynx d.o.o.
 */

package com.alesj.blueberry.par.basic;

import javax.persistence.*;
import java.util.Map;
import java.io.Serializable;

/**
 * Abstract object holding common request information.
 *
 * @author <a href="mailto:ales.justin@genera-lynx.com">Ales Justin</a>
 */
@Entity
@Table(name = "game_object")
@Inheritance(strategy = InheritanceType.JOINED)
public abstract class GameObject implements Serializable {

    private Integer id;
    private RequestEntry requestEntry;
    private double price;

    public abstract String info();

    public abstract void fillResultMap(Map<String, Object> resultMap);

    @Id
    @GeneratedValue
    @Column(name = "game_object_id", unique = true, nullable = false)
    public Integer getId() {
        return this.id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @OneToOne
    @JoinColumn(name = "request_entry_id", unique = true, nullable = true, insertable = true, updatable = true)
    public RequestEntry getRequestEntry() {
        return requestEntry;
    }

    public void setRequestEntry(RequestEntry requestEntry) {
        this.requestEntry = requestEntry;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

}
